package com.tencent.qcloud.uikit;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;

/**
 * Created by Administrator on 2019/3/20.
 */

public class HTTPAPI {

    public static HTTPAPI instance;

    public static HTTPAPI getInstance() {
        if (instance == null) {
            instance = new HTTPAPI();
        }
        return instance;
    }

    /**
     * 根据昵称获取头像
     * @param username      昵称
     * @param callback      联网回调
     */
    public void getHeadImg(String username,StringCallback callback){
        OkGo.post("http://192.168.1.108/public/index.php/api/Person/getHeadimg")
                .tag(this)
                .connTimeOut(30000)
                .params("username",username)
                .execute(callback);

    }

}
